<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>em与rem</title>
    <style>
        html{
            font-size: 16px;
        }
        .div1, .div2, .div3{
            border: 1px solid red;
            font-size: 12px;
        }
        .div1 p{
            font-size: 32px;
        }
        .div2 p{
            font-size: 2em;
        }
        .div3 p{
            font-size: 2rem;
        }
    </style>
</head>
<body>
    <!--
    px, em, rem
    px:像素点多少
    em: 相对父元素字体大小的倍数
    rem: 相对html元素字体大小的倍数
    -->
    <div class="div1">
        <p>赵钱孙李</p>
    </div>
    <div class="div2">
        <p>赵钱孙李</p>
    </div>
    <div class="div3">
        <p>赵钱孙李</p>
    </div>
</body>
</html>